@inner-border-radius: 4px;
@outer-border-radius: 8px;
@default-handler-size: 16px;
@handler-border-size: 2px;

.color-picker {
    position: absolute;
    z-index: 1;

    display: block;

    width: max-content;
    min-width: 232px;

    visibility: visible;

    &-hidden {
        display: none;
    }

    &-panel {
        display: flex;
        flex-direction: column;

        width: 232px;

        background-color: rgb(var(--white-color));
        border-radius: @outer-border-radius;

        &-disabled {
            cursor: not-allowed;
        }
    }

    &-select {
        margin-bottom: var(--margin-xs);

        .color-picker-palette {
            overflow: hidden;
            min-height: 100px;
            border-radius: @inner-border-radius;

            & > .color-picker-gradient {
                border-top-left-radius: 5px;
            }
        }
    }

    &-saturation {
        position: absolute;
        inset: 0;
        border-radius: inherit;
    }

    &-handler {
        transform: translateY(-1px);

        box-sizing: border-box;
        width: @default-handler-size;
        height: @default-handler-size;

        border: @handler-border-size solid #fff;
        border-radius: 50%;
        box-shadow: 0 0 1px 1px rgb(0 0 0 / 6%);
    }

    &-slider {
        width: 100%;

        .color-picker-palette {
            height: 8px;
        }

        .color-picker-gradient {
            border-radius: @inner-border-radius;
        }
    }

    &-color-blocks {
        display: grid;
        grid-template-columns: repeat(10, 1fr);
        grid-template-rows: repeat(9, 1fr);
        gap: var(--margin-xxs);

        width: 232px;
        margin-bottom: var(--margin-xs);
    }

    &-color-block {
        cursor: pointer;

        position: relative;

        overflow: hidden;

        width: 18px;
        height: 18px;

        border-radius: @inner-border-radius;

        &-inner {
            box-sizing: border-box;
            width: 100%;
            height: 100%;

            border: 1px solid rgb(var(--grey-600));
            border-radius: @inner-border-radius;
        }
    }

    &-slider-container {
        display: flex;
        flex-direction: row-reverse;
        gap: var(--margin-sm);

        .color-picker-slider-group {
            flex: 1;

            &-disabled-alpha {
                display: flex;
                align-items: center;

                .color-picker-slider {
                    margin-bottom: 0;
                }
            }
        }
    }
}
